fix: rs274 nullptr will collapse the milltask when hal para is wrong#3465
fix: rs274 nullptr will collapse the milltask when hal para is wrong#3465andypugh merged 3 commits intoLinuxCNC:masterfrom
Conversation
|
This looks reasonable on inspection. Can you describe how to demonstrate the problem that this fixes? |
|
When using the rs274 model directly, you might write code like this: |
|
Apparently, my review comments were not seen, again, ... - static void maybe_new_line(int sequence_number=pinterp->sequence_number());
+ static void maybe_new_line(int sequence_number=0);
static void maybe_new_line(int sequence_number) {
if(!pinterp) return;
if(interp_error) return;
+ sequence_number=pinterp->sequence_number()Your fix would alter the code's operation. The change will assign |
d30ea71 to
1dbe608
Compare
|
Thank you for your feedback and clarification.
Sorry for the earlier mistake, and thank you for pointing it out. |
|
Why a full duplication? Can't you just thunk the arg-less version like in: static void maybe_new_line(int sequence_number);
static void maybe_new_line();
static void maybe_new_line(int sequence_number)
{
...
}
static void maybe_new_line()
{
if(!pinterp) return;
maybe_new_line(pinterp->sequence_number());
}
|
|
Thanks for the suggestion! I've updated the code to delegate the argument-less version to the one with sequence_number, removing the duplication. |
|
Now it should be fine. |
rs274 nullptr will collapse the milltask when hal para is wrong.